use std::io::{self, Write};
use std::io::{Error, ErrorKind};

fn main() -> io::Result<()> {
    let stderr = io::stderr();
    let mut handle = stderr.lock();

    handle.write_all(b"hello world")?;

    Err(Error::new(ErrorKind::Other, "error"))
}
